#pragma once
#include <fstream>
#include <iostream>
#include <string>
// 读取文件的一个工具模块
class Util {
public:
    static bool ReadFileContent(const std::string& filename, std::string* out) {
        std::ifstream in(filename);
        if(!in.is_open()) {
            return false;
        }
        std::string line;
        while(std::getline(in, line)) {
            *out += line; 
        }
        in.close();
        return true;
    }
    static bool ReadOneLine(std::string& str, std::string* out, const std::string& sep) {
        auto pos = str.find(sep);
        if(pos == std::string::npos) {
            return false;
        }
        *out += str.substr(0, pos);
        str.erase(0, pos + sep.size());
        return true;
    }
};